﻿Imports System.IO
Public Class Main 'WARNING: You may get lost in the process of exploring this...disaster zone. Do not assume all markings are accurate, or that redundany does not exist, or that a sub serves a purpose.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        On Error Resume Next
        Dim url As String = "https://pb1.mdeca.org/parentaccess/General/LoginPage.aspx?DistrictID=224"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        On Error Resume Next

        'If File.Exists("skymode.kwl") Then                        'Begin Skydrive setup (future feature)
        'If Directory.Exists("D:\Skydrive\hm") Then

        ' Else
        ' Directory.CreateDirectory("D:\Skydrive\hm")
        ' End If
        ' Directory.Move("week", "D:\Skydrive\hm\")
        'Else
        '  End If                                                    'End Skydrive code
        Me.KeyPreview = True
        If Screen.PrimaryScreen.WorkingArea.Width = 1366 Then
            Me.WindowState = FormWindowState.Maximized
        Else

        End If
        If File.Exists("background.jpg") Then
            Me.BackgroundImage = Image.FromFile("background.jpg")
            Me.BackgroundImageLayout = ImageLayout.Stretch
        Else
        End If
        ' initiate week manager
        If Directory.Exists("week") Then

        Else
            Directory.CreateDirectory("week")
            firststart.Show()
            splash.Close()
            Me.Hide()
        End If
        If File.Exists("week/select.kwl") Then

        Else
            File.Create("week/select.kwl")
        End If
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")

        Button8.Hide()


        'Create main Directories

        If Directory.Exists("week/dump") Then

        Else
            Directory.CreateDirectory("week/dump")
        End If

        If Directory.Exists("week/data") Then

        Else
            Directory.CreateDirectory("week/data")
        End If


        'Create Files
        If File.Exists("week/weeksdata.kwl") Then

        Else
            File.Create("week/weeksdata.kwl")
        End If
        If File.Exists("settings.kwl") Then
            CheckBox1.CheckState = CheckState.Checked
        Else
            CheckBox1.CheckState = CheckState.Unchecked
        End If
        If weekselect = "" Then ' Create default week if string weekselect is empty

            weekselect = "Week 1"

            If Directory.Exists("week/" + weekselect) Then

            Else
                Directory.CreateDirectory("week/" + weekselect)
            End If
            If File.Exists("week/data/" + weekselect) Then

            Else
                File.Create("week/data/" + weekselect)
            End If
            If Directory.Exists("hm_data") Then
                File.Move("hm_data/P1Monday.kwl", "week/" + weekselect + "/P1Monday.kwl")
                File.Move("hm_data/P2Monday.kwl", "week/" + weekselect + "/P2Monday.kwl")
                File.Move("hm_data/P3Monday.kwl", "week/" + weekselect + "/P3Monday.kwl")
                File.Move("hm_data/P4Monday.kwl", "week/" + weekselect + "/P4Monday.kwl")
                File.Move("hm_data/P5Monday.kwl", "week/" + weekselect + "/P5Monday.kwl")
                File.Move("hm_data/P6Monday.kwl", "week/" + weekselect + "/P6Monday.kwl")
                File.Move("hm_data/P1Tusday.kwl", "week/" + weekselect + "/P1Tusday.kwl")
                File.Move("hm_data/P2Tusday.kwl", "week/" + weekselect + "/P2Tusday.kwl")
                File.Move("hm_data/P3Tusday.kwl", "week/" + weekselect + "/P3Tusday.kwl")
                File.Move("hm_data/P4Tusday.kwl", "week/" + weekselect + "/P4Tusday.kwl")
                File.Move("hm_data/P5Tusday.kwl", "week/" + weekselect + "/P5Tusday.kwl")
                File.Move("hm_data/P6Tusday.kwl", "week/" + weekselect + "/P6Tusday.kwl")
                File.Move("hm_data/P1Wednesday.kwl", "week/" + weekselect + "/P1Wednesday.kwl")
                File.Move("hm_data/P2Wednesday.kwl", "week/" + weekselect + "/P2Wednesday.kwl")
                File.Move("hm_data/P3Wednesday.kwl", "week/" + weekselect + "/P3Wednesday.kwl")
                File.Move("hm_data/P4Wednesday.kwl", "week/" + weekselect + "/P4Wednesday.kwl")
                File.Move("hm_data/P5Wednesday.kwl", "week/" + weekselect + "/P5Wednesday.kwl")
                File.Move("hm_data/P6Wednesday.kwl", "week/" + weekselect + "/P6Wednesday.kwl")
                File.Move("hm_data/P1Thursday.kwl", "week/" + weekselect + "/P1Thursday.kwl")
                File.Move("hm_data/P2Thursday.kwl", "week/" + weekselect + "/P2Thursday.kwl")
                File.Move("hm_data/P3Thursday.kwl", "week/" + weekselect + "/P3Thursday.kwl")
                File.Move("hm_data/P4Thursday.kwl", "week/" + weekselect + "/P4Thursday.kwl")
                File.Move("hm_data/P5Thursday.kwl", "week/" + weekselect + "/P5Thursday.kwl")
                File.Move("hm_data/P6Thursday.kwl", "week/" + weekselect + "/P6Thursday.kwl")
                File.Move("hm_data/P1Friday.kwl", "week/" + weekselect + "/P1Friday.kwl")
                File.Move("hm_data/P2Friday.kwl", "week/" + weekselect + "/P2Friday.kwl")
                File.Move("hm_data/P3Friday.kwl", "week/" + weekselect + "/P3Friday.kwl")
                File.Move("hm_data/P4Friday.kwl", "week/" + weekselect + "/P4Friday.kwl")
                File.Move("hm_data/P5Friday.kwl", "week/" + weekselect + "/P5Friday.kwl")
                File.Move("hm_data/P6Friday.kwl", "week/" + weekselect + "/P6Friday.kwl")
                File.Move("hm_data/Notes.kwl", "week/" + weekselect + "/Notes.kwl")
                Directory.Delete("hm_data")

            End If
            If File.Exists("week/" + weekselect + "/P1Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P1Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P1Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P1Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P1Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/Notes.kwl") Then

            Else
                File.Create("week/" + weekselect + "/Notes.kwl")

            End If

        Else

        End If

        If File.Exists("week/dump/P1Monday.kwl") Then

        Else
            File.Create("week/dump/P1Monday.kwl")

        End If

        If File.Exists("week/dump/P1Tusday.kwl") Then

        Else
            File.Create("week/dump/P1Tusday.kwl")

        End If

        If File.Exists("week/dump/P1Wednesday.kwl") Then

        Else
            File.Create("week/dump/P1Wednesday.kwl")

        End If

        If File.Exists("week/dump/P1Thursday.kwl") Then

        Else
            File.Create("week/dump/P1Thursday.kwl")

        End If

        If File.Exists("week/dump/P1Friday.kwl") Then

        Else
            File.Create("week/dump/P1Friday.kwl")

        End If

        If File.Exists("week/dump/P2Monday.kwl") Then

        Else
            File.Create("week/dump/P2Monday.kwl")

        End If

        If File.Exists("week/dump/P2Tusday.kwl") Then

        Else
            File.Create("week/dump/P2Tusday.kwl")

        End If

        If File.Exists("week/dump/P2Wednesday.kwl") Then

        Else
            File.Create("week/dump/P2Wednesday.kwl")

        End If

        If File.Exists("week/dump/P2Thursday.kwl") Then

        Else
            File.Create("week/dump/P2Thursday.kwl")

        End If

        If File.Exists("week/dump/P2Friday.kwl") Then

        Else
            File.Create("week/dump/P2Friday.kwl")

        End If

        If File.Exists("week/dump/P3Monday.kwl") Then

        Else
            File.Create("week/dump/P3Monday.kwl")

        End If

        If File.Exists("week/dump/P3Tusday.kwl") Then

        Else
            File.Create("week/dump/P3Tusday.kwl")

        End If

        If File.Exists("week/dump/P3Wednesday.kwl") Then

        Else
            File.Create("week/dump/P3Wednesday.kwl")

        End If

        If File.Exists("week/dump/P3Thursday.kwl") Then

        Else
            File.Create("week/dump/P3Thursday.kwl")

        End If

        If File.Exists("week/dump/P3Friday.kwl") Then

        Else
            File.Create("week/dump/P3Friday.kwl")

        End If

        If File.Exists("week/dump/P4Monday.kwl") Then

        Else
            File.Create("week/dump/P4Monday.kwl")

        End If

        If File.Exists("week/dump/P4Tusday.kwl") Then

        Else
            File.Create("week/dump/P4Tusday.kwl")

        End If

        If File.Exists("week/dump/P4Wednesday.kwl") Then

        Else
            File.Create("week/dump/P4Wednesday.kwl")

        End If

        If File.Exists("week/dump/P4Thursday.kwl") Then

        Else
            File.Create("week/dump/P4Thursday.kwl")

        End If

        If File.Exists("week/dump/P4Friday.kwl") Then

        Else
            File.Create("week/dump/P4Friday.kwl")

        End If

        If File.Exists("week/dump/P5Monday.kwl") Then

        Else
            File.Create("week/dump/P5Monday.kwl")

        End If

        If File.Exists("week/dump/P5Tusday.kwl") Then

        Else
            File.Create("week/dump/P5Tusday.kwl")

        End If

        If File.Exists("week/dump/P5Wednesday.kwl") Then

        Else
            File.Create("week/dump/P5Wednesday.kwl")

        End If

        If File.Exists("week/dump/P5Thursday.kwl") Then

        Else
            File.Create("week/dump/P5Thursday.kwl")

        End If

        If File.Exists("week/dump/P5Friday.kwl") Then

        Else
            File.Create("week/dump/P5Friday.kwl")

        End If

        If File.Exists("week/dump/P6Monday.kwl") Then

        Else
            File.Create("week/dump/P6Monday.kwl")

        End If

        If File.Exists("week/dump/P6Tusday.kwl") Then

        Else
            File.Create("week/dump/P6Tusday.kwl")

        End If

        If File.Exists("week/dump/P6Wednesday.kwl") Then

        Else
            File.Create("week/dump/P6Wednesday.kwl")

        End If

        If File.Exists("week/dump/P6Thursday.kwl") Then

        Else
            File.Create("week/dump/P6Thursday.kwl")

        End If

        If File.Exists("week/dump/P6Friday.kwl") Then

        Else
            File.Create("week/dump/P6Friday.kwl")

        End If

        If File.Exists("week/dump/Notes.kwl") Then

        Else
            File.Create("week/dump/Notes.kwl")

        End If


        NotifyIcon1.ContextMenuStrip = ContextMenuStrip1


        Label42.Text = weekselect
        Button7.PerformClick()
        Button8.Hide()
        If firststart.Visible Then
            Me.Hide()
            splash.Hide()
            splash.Close()
            MsgBox("The DRSS Homework Manager has finished its first run setup. Please restart the program to apply the changes.")
            End
        End If

        'Temp upgrade code
        If File.Exists("updater2.exe") Then
            File.Delete("updater2.exe")
        End If
        If File.Exists("updater.exe") Then
            File.Delete("updater.exe")
        End If
        '/temp upgrade code
        If Err.Number <> 0 Then
            MsgBox("A error occured:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, "DRSS Homework Manager")
        Else

        End If

    End Sub
    Private Sub keys_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If (e.Control AndAlso (e.KeyCode = Keys.S)) Then
            Me.Button8_Click(sender, New System.EventArgs())
        End If
        
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Button7_Click(sender, New System.EventArgs())
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If File.Exists("C:/Program Files (x86)/Microsoft Office/Office14/powerpnt.exe") Then
            System.Diagnostics.Process.Start("C:/Program Files (x86)/Microsoft Office/Office14/powerpnt.exe")
        Else
            MsgBox("Powerpoint is not on this computer.")
        End If

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        On Error Resume Next
        Dim url As String = "https://pilot.wright.edu"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        On Error Resume Next
        Dim url As String = "https://outlook.com"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        On Error Resume Next
        Dim weekselect As String
        Dim errormessage As String
        errormessage = "One of the database files is missing ... this usually is a sign of a serious bug. Please email kowal@innocent.com to report it. Include details about what you did at the time it occured."
        weekselect = File.ReadAllText("week/select.kwl")
        If weekselect = "" Then
            weekselect = "Week 1"
        Else

        End If
        'Period 1
        Dim FILE_NAME As String = "week/" + weekselect + "/P1Monday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            objWriter.Write(m1.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAME1 As String = "week/" + weekselect + "/P1Tusday.kwl"
        If File.Exists(FILE_NAME1) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME1)
            objWriter.Write(tu1.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEw1 As String = "week/" + weekselect + "/P1Wednesday.kwl"
        If File.Exists(FILE_NAME1) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEw1)
            objWriter.Write(w1.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtr1 As String = "week/" + weekselect + "/P1Thursday.kwl"
        If File.Exists(FILE_NAME1) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtr1)
            objWriter.Write(tr1.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEf1 As String = "week/" + weekselect + "/P1Friday.kwl"
        If File.Exists(FILE_NAME1) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEf1)
            objWriter.Write(f1.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If
        ' Period 2
        Dim FILE_NAMEm2 As String = "week/" + weekselect + "/P2Monday.kwl"
        If File.Exists(FILE_NAMEm2) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEm2)
            objWriter.Write(m2.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtu2 As String = "week/" + weekselect + "/P2Tusday.kwl"
        If File.Exists(FILE_NAMEtu2) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtu2)
            objWriter.Write(tu2.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEw2 As String = "week/" + weekselect + "/P2Wednesday.kwl"
        If File.Exists(FILE_NAMEw2) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEw2)
            objWriter.Write(w2.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtr2 As String = "week/" + weekselect + "/P2Thursday.kwl"
        If File.Exists(FILE_NAMEtr2) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtr2)
            objWriter.Write(tr2.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEf2 As String = "week/" + weekselect + "/P2Friday.kwl"
        If File.Exists(FILE_NAMEf2) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEf2)
            objWriter.Write(f2.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If
        'Period 3
        Dim FILE_NAMEm3 As String = "week/" + weekselect + "/P3Monday.kwl"
        If File.Exists(FILE_NAMEm3) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEm3)
            objWriter.Write(m3.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtu3 As String = "week/" + weekselect + "/P3Tusday.kwl"
        If File.Exists(FILE_NAMEtu3) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtu3)
            objWriter.Write(tu3.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEw3 As String = "week/" + weekselect + "/P3Wednesday.kwl"
        If File.Exists(FILE_NAMEw3) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEw3)
            objWriter.Write(w3.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtr3 As String = "week/" + weekselect + "/P3Thursday.kwl"
        If File.Exists(FILE_NAMEtr3) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtr3)
            objWriter.Write(tr3.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEf3 As String = "week/" + weekselect + "/P3Friday.kwl"
        If File.Exists(FILE_NAMEf3) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEf3)
            objWriter.Write(f3.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If
        'Period 4
        Dim FILE_NAMEm4 As String = "week/" + weekselect + "/P4Monday.kwl"
        If File.Exists(FILE_NAMEm4) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEm4)
            objWriter.Write(m4.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtu4 As String = "week/" + weekselect + "/P4Tusday.kwl"
        If File.Exists(FILE_NAMEtu4) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtu4)
            objWriter.Write(tu4.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEw4 As String = "week/" + weekselect + "/P4Wednesday.kwl"
        If File.Exists(FILE_NAMEw4) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEw4)
            objWriter.Write(w4.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtr4 As String = "week/" + weekselect + "/P4Thursday.kwl"
        If File.Exists(FILE_NAMEtr4) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtr4)
            objWriter.Write(tr4.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEf4 As String = "week/" + weekselect + "/P4Friday.kwl"
        If File.Exists(FILE_NAMEf4) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEf4)
            objWriter.Write(f4.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If
        'Period 5
        Dim FILE_NAMEm5 As String = "week/" + weekselect + "/P5Monday.kwl"
        If File.Exists(FILE_NAMEm5) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEm5)
            objWriter.Write(m5.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtu5 As String = "week/" + weekselect + "/P5Tusday.kwl"
        If File.Exists(FILE_NAMEtu5) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtu5)
            objWriter.Write(tu5.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEw5 As String = "week/" + weekselect + "/P5Wednesday.kwl"
        If File.Exists(FILE_NAMEw5) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEw5)
            objWriter.Write(w5.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtr5 As String = "week/" + weekselect + "/P5Thursday.kwl"
        If File.Exists(FILE_NAMEtr5) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtr5)
            objWriter.Write(tr5.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEf5 As String = "week/" + weekselect + "/P5Friday.kwl"
        If File.Exists(FILE_NAMEf5) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEf5)
            objWriter.Write(f5.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If
        'Period 6
        Dim FILE_NAMEm6 As String = "week/" + weekselect + "/P6Monday.kwl"
        If File.Exists(FILE_NAMEm6) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEm6)
            objWriter.Write(m6.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtu6 As String = "week/" + weekselect + "/P6Tusday.kwl"
        If File.Exists(FILE_NAMEtu6) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtu6)
            objWriter.Write(tu6.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEw6 As String = "week/" + weekselect + "/P6Wednesday.kwl"
        If File.Exists(FILE_NAMEw6) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEw6)
            objWriter.Write(w6.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEtr6 As String = "week/" + weekselect + "/P6Thursday.kwl"
        If File.Exists(FILE_NAMEtr6) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEtr6)
            objWriter.Write(tr6.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEf6 As String = "week/" + weekselect + "/P6Friday.kwl"
        If File.Exists(FILE_NAMEf6) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEf6)
            objWriter.Write(f6.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Dim FILE_NAMEnotes As String = "week/" + weekselect + "/Notes.kwl"
        If File.Exists(FILE_NAMEnotes) = True Then
            Dim objWriter As New StreamWriter(FILE_NAMEnotes)
            objWriter.Write(notes.Text)
            objWriter.Close()
        Else
            MsgBox(errormessage)
        End If

        Button8.Hide()
        If Err.Number <> 0 Then
            MsgBox("A error occured:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, "DRSS Homework Manager")
        Else

        End If

    End Sub

    Public Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        ' NOTICE: This is for the "Load Saved Work" button, which was made invisible in dev .14. It is here as a 'unanticipated variable' fallback option.
        On Error Resume Next
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")
        If weekselect = "" Then
            weekselect = "Week 1"
        Else

        End If
        Button8.Show()
        m1.LoadFile("week/" + weekselect + "/P1Monday.kwl", RichTextBoxStreamType.PlainText)
        tu1.LoadFile("week/" + weekselect + "/P1Tusday.kwl", RichTextBoxStreamType.PlainText)
        w1.LoadFile("week/" + weekselect + "/P1Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr1.LoadFile("week/" + weekselect + "/P1Thursday.kwl", RichTextBoxStreamType.PlainText)
        f1.LoadFile("week/" + weekselect + "/P1Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 2
        m2.LoadFile("week/" + weekselect + "/P2Monday.kwl", RichTextBoxStreamType.PlainText)
        tu2.LoadFile("week/" + weekselect + "/P2Tusday.kwl", RichTextBoxStreamType.PlainText)
        w2.LoadFile("week/" + weekselect + "/P2Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr2.LoadFile("week/" + weekselect + "/P2Thursday.kwl", RichTextBoxStreamType.PlainText)
        f2.LoadFile("week/" + weekselect + "/P2Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 3
        m3.LoadFile("week/" + weekselect + "/P3Monday.kwl", RichTextBoxStreamType.PlainText)
        tu3.LoadFile("week/" + weekselect + "/P3Tusday.kwl", RichTextBoxStreamType.PlainText)
        w3.LoadFile("week/" + weekselect + "/P3Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr3.LoadFile("week/" + weekselect + "/P3Thursday.kwl", RichTextBoxStreamType.PlainText)
        f3.LoadFile("week/" + weekselect + "/P3Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 4
        m4.LoadFile("week/" + weekselect + "/P4Monday.kwl", RichTextBoxStreamType.PlainText)
        tu4.LoadFile("week/" + weekselect + "/P4Tusday.kwl", RichTextBoxStreamType.PlainText)
        w4.LoadFile("week/" + weekselect + "/P4Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr4.LoadFile("week/" + weekselect + "/P4Thursday.kwl", RichTextBoxStreamType.PlainText)
        f4.LoadFile("week/" + weekselect + "/P4Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 5
        m5.LoadFile("week/" + weekselect + "/P5Monday.kwl", RichTextBoxStreamType.PlainText)
        tu5.LoadFile("week/" + weekselect + "/P5Tusday.kwl", RichTextBoxStreamType.PlainText)
        w5.LoadFile("week/" + weekselect + "/P5Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr5.LoadFile("week/" + weekselect + "/P5Thursday.kwl", RichTextBoxStreamType.PlainText)
        f5.LoadFile("week/" + weekselect + "/P5Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 6
        m6.LoadFile("week/" + weekselect + "/P6Monday.kwl", RichTextBoxStreamType.PlainText)
        tu6.LoadFile("week/" + weekselect + "/P6Tusday.kwl", RichTextBoxStreamType.PlainText)
        w6.LoadFile("week/" + weekselect + "/P6Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr6.LoadFile("week/" + weekselect + "/P6Thursday.kwl", RichTextBoxStreamType.PlainText)
        f6.LoadFile("week/" + weekselect + "/P6Friday.kwl", RichTextBoxStreamType.PlainText)
        'Other
        notes.LoadFile("week/" + weekselect + "/Notes.kwl", RichTextBoxStreamType.PlainText)
        Button7.Hide()
        If Err.Number <> 0 Then
            MsgBox("A error occured:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, "DRSS Homework Manager")
        End If
    End Sub

    Private Sub tu2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu2.TextChanged    'slightly out of place
        Button8.Show()
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        On Error Resume Next
        Dim url As String = "https://skydrive.live.com"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        about.Show()

    End Sub

    Private Sub Button11_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        If File.Exists("C:/WINDOWS/system32/calc.exe") Then
            System.Diagnostics.Process.Start("C:/WINDOWS/system32/calc.exe")
        Else
            MsgBox("The Calculator is not present on this computer.")
        End If
    End Sub

    Private Sub notes_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles notes.TextChanged
        Button8.Show()
    End Sub

    Private Sub m1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m1.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu1.TextChanged
        Button8.Show()
    End Sub

    Private Sub w1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w1.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr1.TextChanged
        Button8.Show()
    End Sub

    Private Sub f1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f1.TextChanged
        Button8.Show()
    End Sub

    Private Sub m2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m2.TextChanged
        Button8.Show()
    End Sub

    Private Sub w2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w2.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr2.TextChanged
        Button8.Show()
    End Sub

    Private Sub f2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f2.TextChanged
        Button8.Show()
    End Sub

    Private Sub m3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m3.TextChanged
        Button8.Show()
    End Sub

    Private Sub f3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f3.TextChanged
        Button8.Show()
    End Sub

    Private Sub w3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w3.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr3.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu3.TextChanged
        Button8.Show()
    End Sub

    Private Sub m4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m4.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu4.TextChanged
        Button8.Show()
    End Sub

    Private Sub f4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f4.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr4.TextChanged
        Button8.Show()
    End Sub

    Private Sub w4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w4.TextChanged
        Button8.Show()
    End Sub

    Private Sub m5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m5.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu5.TextChanged
        Button8.Show()
    End Sub

    Private Sub w5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w5.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr5.TextChanged
        Button8.Show()
    End Sub

    Private Sub f5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f5.TextChanged
        Button8.Show()
    End Sub

    Private Sub m6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m6.TextChanged
        Button8.Show()
    End Sub

    Private Sub f6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f6.TextChanged
        Button8.Show()
    End Sub

    Private Sub w6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w6.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr6.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu6.TextChanged
        Button8.Show()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If File.Exists("C:/Program Files (x86)/Microsoft Office/Office14/excel.exe") Then
            System.Diagnostics.Process.Start("C:/Program Files (x86)/Microsoft Office/Office14/excel.exe")
        Else
            MsgBox("Excel 2010 is not on this computer")
        End If
    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click

        Dim ofd As New OpenFileDialog
        With ofd
            .CheckFileExists = True
            .Filter = "Image Files (*.jpg)|*.jpg"
            .Title = "Change your planner's background image:"
            .ShowDialog()
        End With

        If DialogResult = Windows.Forms.DialogResult.OK AndAlso ofd.FileName <> "" Then

        Else
            Try
                If File.Exists(ofd.FileName) Then
                    Me.BackgroundImage.Dispose()
                    Me.BackgroundImage = Image.FromFile(ofd.FileName)
                    Me.BackgroundImageLayout = ImageLayout.Stretch
                Else

                    Exit Sub
                End If
            Catch ex As Exception
                MsgBox(ex.Message)
                Debug.Print(ex.Message)
            End Try
            If ofd.FileName = "" Then
                Exit Sub
            Else

                Me.BackgroundImage.Save("background.jpg")

            End If

        End If
    End Sub


    Private Sub Msgbox_Yes_No()

    End Sub

    Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick

    End Sub
    Public Sub NotifyIcon1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDown
        If e.Button = MouseButtons.Left Then
            Me.Show()
            sidebar.Close()
        End If
        If Me.WindowState = FormWindowState.Minimized Then
            Me.WindowState = FormWindowState.Maximized
            sidebar.Close()
        End If
        Me.BringToFront()
    End Sub
    Private Sub Form1_FormClosing(ByVal sender As Object, _
                              ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If e.CloseReason = CloseReason.UserClosing Then
            'The user has requested the form be closed so mimimise to the system tray instead.
            e.Cancel = True
            Me.Visible = False
            Me.NotifyIcon1.Visible = True
        End If
        If CheckBox1.CheckState = CheckState.Checked Then
            sidebar.Show()
        End If
    End Sub
    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        Try
            If Me.WindowState = FormWindowState.Minimized Then
                Me.WindowState = FormWindowState.Minimized
                NotifyIcon1.Visible = True
                Me.Hide()
            End If
        Catch ex As Exception
        End Try
        If Me.WindowState = FormWindowState.Maximized Then
        Else
            If Me.Visible Then
            Else
                If CheckBox1.CheckState = CheckState.Checked Then
                    sidebar.Show()
                End If
            End If

        End If

    End Sub
    Private Sub NotifyIcon1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        If e.Button = MouseButtons.Right Then NotifyIcon1.ContextMenuStrip.Show()
    End Sub
    Private Sub ContextMenuStrip1_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
        ' Do something if notifyicon's menu is shown
    End Sub

    Public Sub ToolStripMenuItem1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Exitmenuitem.Click
        On Error Resume Next
        If CheckBox1.CheckState = CheckState.Checked Then
            If File.Exists("settings.kwl") Then
            Else
                File.Create("settings.kwl")
            End If
        End If
        If CheckBox1.CheckState = CheckState.Unchecked Then
            If File.Exists("settings.kwl") Then
                File.Delete("settings.kwl")
            Else
            End If
        End If
        Me.Show()
        If Button8.Visible Then
            If MessageBox.Show("You may have unsaved changes. Would you like to save these changes?", "Save", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
                Button8.PerformClick()
                If Err.Number <> 0 Then
                    MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
                Else
                End If
                End
            End If
        End If
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
        End
    End Sub

    Private Sub PilotToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PilotToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "https://pilot.wright.edu"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub EmailToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EmailToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "https://outlook.com"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub ContextMenuStrip1_Opening_1(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening

    End Sub

    Private Sub SkydriveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SkydriveToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "https://skydrive.live.com"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub ProgressBookToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBookToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "https://pb1.mdeca.org/parentaccess/General/LoginPage.aspx?DistrictID=224"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        weeks.Show()
    End Sub

    Private Sub WordToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WordToolStripMenuItem.Click
        If File.Exists("C:/Program Files (x86)/Microsoft Office/Office14/winword.exe") Then
            System.Diagnostics.Process.Start("C:/Program Files (x86)/Microsoft Office/Office14/winword.exe")
        Else
            MsgBox("Word is not on this computer.")
        End If
    End Sub

    Private Sub PowerpointToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PowerpointToolStripMenuItem.Click
        If File.Exists("C:/Program Files (x86)/Microsoft Office/Office14/powerpnt.exe") Then
            System.Diagnostics.Process.Start("C:/Program Files (x86)/Microsoft Office/Office14/powerpnt.exe")
        Else
            MsgBox("Powerpoint is not on this computer.")
        End If
    End Sub

    Private Sub ExcelToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcelToolStripMenuItem.Click
        If File.Exists("C:/Program Files (x86)/Microsoft Office/Office14/excel.exe") Then
            System.Diagnostics.Process.Start("C:/Program Files (x86)/Microsoft Office/Office14/excel.exe")
        Else
            MsgBox("Excel 2010 is not on this computer")
        End If
    End Sub

    Private Sub CalculatorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculatorToolStripMenuItem.Click
        If File.Exists("C:/WINDOWS/system32/calc.exe") Then
            System.Diagnostics.Process.Start("C:/WINDOWS/system32/calc.exe")
        Else
            MsgBox("The Calculator is not present on this computer.(?!?!)")
        End If
    End Sub

    Private Sub NotifyToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
        ' NOTE: In dev. 14 and beyond, this sub has no purpose. It is remnants of the Notify system
        On Error Resume Next
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")
        If Today.DayOfWeek = DayOfWeek.Monday Then
            Dim mper1 As String
            Dim mper2 As String
            Dim mper3 As String
            Dim mper4 As String
            Dim mper5 As String
            Dim mper6 As String
            mper1 = File.ReadAllText("week/" + weekselect + "/P1Monday.kwl")
            mper2 = File.ReadAllText("week/" + weekselect + "/P2Monday.kwl")
            mper3 = File.ReadAllText("week/" + weekselect + "/P3Monday.kwl")
            mper4 = File.ReadAllText("week/" + weekselect + "/P4Monday.kwl")
            mper5 = File.ReadAllText("week/" + weekselect + "/P5Monday.kwl")
            mper6 = File.ReadAllText("week/" + weekselect + "/P6Monday.kwl")
            MsgBox("Things due Monday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + mper1 + vbNewLine + "Period 2: " + mper2 + vbNewLine + "Period 3: " + mper3 + vbNewLine + "Period 4: " + mper4 + vbNewLine + "Period 5: " + mper5 + vbNewLine + "Period 6: " + mper6)
        Else

        End If
        If Today.DayOfWeek = DayOfWeek.Tuesday Then
            Dim tper1 As String
            Dim tper2 As String
            Dim tper3 As String
            Dim tper4 As String
            Dim tper5 As String
            Dim tper6 As String
            tper1 = File.ReadAllText("week/" + weekselect + "/P1Tusday.kwl")
            tper2 = File.ReadAllText("week/" + weekselect + "/P2Tusday.kwl")
            tper3 = File.ReadAllText("week/" + weekselect + "/P3Tusday.kwl")
            tper4 = File.ReadAllText("week/" + weekselect + "/P4Tusday.kwl")
            tper5 = File.ReadAllText("week/" + weekselect + "/P5Tusday.kwl")
            tper6 = File.ReadAllText("week/" + weekselect + "/P6Tusday.kwl")
            MsgBox("Things due Tuesday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + tper1 + vbNewLine + "Period 2: " + tper2 + vbNewLine + "Period 3: " + tper3 + vbNewLine + "Period 4: " + tper4 + vbNewLine + "Period 5: " + tper5 + vbNewLine + "Period 6: " + tper6)
        Else

        End If
        If Today.DayOfWeek = DayOfWeek.Wednesday Then
            Dim wper1 As String
            Dim wper2 As String
            Dim wper3 As String
            Dim wper4 As String
            Dim wper5 As String
            Dim wper6 As String
            wper1 = File.ReadAllText("week/" + weekselect + "/P1Wednesday.kwl")
            wper2 = File.ReadAllText("week/" + weekselect + "/P2Wednesday.kwl")
            wper3 = File.ReadAllText("week/" + weekselect + "/P3Wednesday.kwl")
            wper4 = File.ReadAllText("week/" + weekselect + "/P4Wednesday.kwl")
            wper5 = File.ReadAllText("week/" + weekselect + "/P5Wednesday.kwl")
            wper6 = File.ReadAllText("week/" + weekselect + "/P6Wednesday.kwl")
            MsgBox("Things due Wednesday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + wper1 + vbNewLine + "Period 2: " + wper2 + vbNewLine + "Period 3: " + wper3 + vbNewLine + "Period 4: " + wper4 + vbNewLine + "Period 5: " + wper5 + vbNewLine + "Period 6: " + wper6)
        Else

        End If
        If Today.DayOfWeek = DayOfWeek.Thursday Then
            Dim thper1 As String
            Dim thper2 As String
            Dim thper3 As String
            Dim thper4 As String
            Dim thper5 As String
            Dim thper6 As String
            thper1 = File.ReadAllText("week/" + weekselect + "/P1Thursday.kwl")
            thper2 = File.ReadAllText("week/" + weekselect + "/P2Thursday.kwl")
            thper3 = File.ReadAllText("week/" + weekselect + "/P3Thursday.kwl")
            thper4 = File.ReadAllText("week/" + weekselect + "/P4Thursday.kwl")
            thper5 = File.ReadAllText("week/" + weekselect + "/P5Thursday.kwl")
            thper6 = File.ReadAllText("week/" + weekselect + "/P6Thursday.kwl")
            MsgBox("Things due Thursday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + thper1 + vbNewLine + "Period 2: " + thper2 + vbNewLine + "Period 3: " + thper3 + vbNewLine + "Period 4: " + thper4 + vbNewLine + "Period 5: " + thper5 + vbNewLine + "Period 6: " + thper6)
        Else

        End If
        If Today.DayOfWeek = DayOfWeek.Friday Then
            Dim fper1 As String
            Dim fper2 As String
            Dim fper3 As String
            Dim fper4 As String
            Dim fper5 As String
            Dim fper6 As String
            fper1 = File.ReadAllText("week/" + weekselect + "/P1Friday.kwl")
            fper2 = File.ReadAllText("week/" + weekselect + "/P2Friday.kwl")
            fper3 = File.ReadAllText("week/" + weekselect + "/P3Friday.kwl")
            fper4 = File.ReadAllText("week/" + weekselect + "/P4Friday.kwl")
            fper5 = File.ReadAllText("week/" + weekselect + "/P5Friday.kwl")
            fper6 = File.ReadAllText("week/" + weekselect + "/P6Friday.kwl")
            MsgBox("Things due Friday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + fper1 + vbNewLine + "Period 2: " + fper2 + vbNewLine + "Period 3: " + fper3 + vbNewLine + "Period 4: " + fper4 + vbNewLine + "Period 5: " + fper5 + vbNewLine + "Period 6: " + fper6)
        Else

        End If
        If Today.DayOfWeek = DayOfWeek.Saturday Then
            MsgBox("What are you doing looking at this on a saturday?! Get a life!")
        Else

        End If
        If Today.DayOfWeek = DayOfWeek.Sunday Then
            Dim mper1 As String
            Dim mper2 As String
            Dim mper3 As String
            Dim mper4 As String
            Dim mper5 As String
            Dim mper6 As String
            mper1 = File.ReadAllText("week/" + weekselect + "/P1Monday.kwl")
            mper2 = File.ReadAllText("week/" + weekselect + "/P2Monday.kwl")
            mper3 = File.ReadAllText("week/" + weekselect + "/P3Monday.kwl")
            mper4 = File.ReadAllText("week/" + weekselect + "/P4Monday.kwl")
            mper5 = File.ReadAllText("week/" + weekselect + "/P5Monday.kwl")
            mper6 = File.ReadAllText("week/" + weekselect + "/P6Monday.kwl")
            MsgBox("Things due tomorrow for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + mper1 + vbNewLine + "Period 2: " + mper2 + vbNewLine + "Period 3: " + mper3 + vbNewLine + "Period 4: " + mper4 + vbNewLine + "Period 5: " + mper5 + vbNewLine + "Period 6: " + mper6)
        Else

        End If
        If Err.Number <> 0 Then
            MsgBox("A error occured:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, "DRSS Homework Manager")
        Else

        End If
    End Sub

    Private Sub NotifyToolStripMenuItem_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs)
        ' Don't know what this is, leaving for research later
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        On Error Resume Next

        If Err.Number <> 0 Then
        End If
    End Sub

    Private Sub CheckBox2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox2.CheckedChanged

    End Sub

    'Comence link code
    Private Sub WolframAlphaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WolframAlphaToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "http://www.wolframalpha.com/"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub KhanAcademyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KhanAcademyToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "http://www.khanacademy.org/"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub WikipediaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WikipediaToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "http://www.wikipedia.org"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub PurdueOWLToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PurdueOWLToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "http://owl.english.purdue.edu/owl/"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub BasicMathToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles BasicMathToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Elementary+Mathematics&a=*C.Elementary+Mathematics-_*ExamplePage-"
        Process.Start(url)
    End Sub

    Private Sub AlToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AlToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=algebra&lk=4&num=1"
        Process.Start(url)
    End Sub

    Private Sub CalculusToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CalculusToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=calculus&lk=4&num=1"
        Process.Start(url)
    End Sub

    Private Sub DiscreteMathmaticsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DiscreteMathmaticsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Discrete+Mathematics"
        Process.Start(url)
    End Sub

    Private Sub MechanicsOfMaterialsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MechanicsOfMaterialsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Mechanics"
        Process.Start(url)
    End Sub

    Private Sub StatisticsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles StatisticsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Statistics"
        Process.Start(url)
    End Sub

    Private Sub PhysicsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PhysicsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Physics"
        Process.Start(url)
    End Sub

    Private Sub GeographyToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GeographyToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Geography"
        Process.Start(url)
    End Sub

    Private Sub MusicTheoryToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MusicTheoryToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Music+theory"
        Process.Start(url)
    End Sub

    Private Sub AstronomyToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AstronomyToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=astronomy&lk=4&num=1"
        Process.Start(url)
    End Sub

    Private Sub TidesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TidesToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=tides"
        Process.Start(url)
    End Sub

    Private Sub USEconomicIndicatorsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles USEconomicIndicatorsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=us+economic+indicators"
        Process.Start(url)
    End Sub

    Private Sub WordsAndLanguageToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles WordsAndLanguageToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Words%20%26%20Linguistics"
        Process.Start(url)
    End Sub

    Private Sub GamingOddsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GamingOddsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Genomics"
        Process.Start(url)
    End Sub

    Private Sub NavianceToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NavianceToolStripMenuItem.Click
        Dim url As String = "https://connection.naviance.com/drstems"
        Process.Start(url)
    End Sub

End Class
' © 2012 Matthew Kowal
'    This program is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 3 of the License, or
'    (at your option) any later version.

'    This program is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.

'    You should have received a copy of the GNU General Public License
'    along with this program.  If not, see <http://www.gnu.org/licenses/>

